(function(){var t=window.BX;if(t.IblockSelectorLanding){return}t.IblockSelectorLanding=function(){this.id="";this.filter=[]};t.IblockSelectorLanding.create=function(i,e){var n=new t.IblockSelectorLanding;n.initialize(i,e);return n};t.IblockSelectorLanding.prototype={initialize:function(i,e){this.id=i;this.settings={defaultFilter:[],internalFilter:[]};this.converterSettings={useQuickSearch:false,quickSearchField:{}};if(t.type.isPlainObject(e)){if(t.type.isArray(e.defaultFilter))this.settings.defaultFilter=e.defaultFilter;if(t.type.isArray(e.internalFilter))this.settings.internalFilter=e.internalFilter;if(t.type.isBoolean(e.useQuickSearch))this.converterSettings.useQuickSearch=e.useQuickSearch;if(this.converterSettings.useQuickSearch&&t.type.isPlainObject(e.quickSearchField)){this.converterSettings.quickSearchField=e.quickSearchField}}this.converter=new t.Landing.UiFilterConverter({filterId:this.id,useQuickSearch:this.converterSettings.useQuickSearch,quickSearchField:this.converterSettings.quickSearchField});this.loadFilter();t.addCustomEvent("BX.Main.Filter:apply",t.proxy(this.applyFilter,this));t.addCustomEvent(t.UI.ButtonPanel,"button-click",function(i){var e;if(t.type.isNotEmptyObject(i)){if(i.TYPE==="save"){top.BX.SidePanel.Instance.postMessageTop(window,"save",{filter:this.filter});e=top.BX.SidePanel.Instance.getSliderByWindow(window);if(e){e.close(true);top.BX.SidePanel.Instance.destroy(e.getUrl())}e=null}}}.bind(this))},loadFilter:function(){this.filter=this.converter.getFilter();if(this.settings.internalFilter.length>0)this.filter=[].concat(this.settings.internalFilter,this.filter);if(this.filter.length===0)this.filter=this.settings.defaultFilter},applyFilter:function(t,i,e,n,r){if(t!==this.id){return}this.loadFilter()}}})();
//# sourceMappingURL=script.map.js